package com.tyrianoid;

import android.app.Activity;
import android.app.AlertDialog;
import android.os.Bundle;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;

public class ScreenOptions extends Activity {

	static final int DIALOG_OPT = 0;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.options);

		/* Reference to this object */
		final ScreenOptions mainObj = this;

		/* Accelerometer */
		final CheckBox cAccel = (CheckBox) findViewById(R.id.CheckAccel);
		
		cAccel.setChecked(GameOptions.getInstance().isAccelerometer());

		cAccel.setOnCheckedChangeListener(new OnCheckedChangeListener() {
			public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
				GameOptions.getInstance().setAccelerometer(cAccel.isChecked());

				//new AlertDialog.Builder(mainObj).setMessage(
				//		Boolean.toString(GameOptions.getInstance()
				//				.isAccelerometer())).show();
			}
		});

		/* Auto-shoot */
		final CheckBox cAuto = (CheckBox) findViewById(R.id.CheckAutoShoot);
		
		cAuto.setChecked(GameOptions.getInstance().isAutoshoot());

		cAuto.setOnCheckedChangeListener(new OnCheckedChangeListener() {
			public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
				GameOptions.getInstance().setAutoshoot(cAuto.isChecked());

				//new AlertDialog.Builder(mainObj).setMessage(
				//		Boolean.toString(GameOptions.getInstance()
				//				.isAutoshoot())).show();
			}
		});
		
	}

	protected void onDestroy() {
		super.onDestroy();
	}

}